<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:dt="http://java.sun.com/jsf/composite/components"
                xmlns:p="http://primefaces.org/ui"
                template="./template2.xhtml">
    
    <ui:define name="mainContent">
        <h2>League Invitation</h2>
        <div class="inset">
                <h4 class="fancy">#{leagueBean.name}</h4>
                <div class="inset">
                    <form id="form?">
                        <h4 class="fancy">Your team name</h4>
                        <p:inputText value="#{leagueBean.yourTeam}"/>
                        <p:commandButton value="Submit" update="yourTeamOutput,teamOutput" /><br/>
                        <h:outputLabel value="#{leagueBean.yourTeam}" id="yourTeamOutput" />
                    </form>
                        <h:panelGrid id="teams">
                            <h5 class="fancy"> Administrator</h5>
                            <h:outputLabel value="#{leagueBean.adminTeam}" id="teamOutput" />
                            <h5 class="fancy"> Accepted</h5>
                            <ui:repeat value="#{leagueBean.acceptedTeams}" var="acceptedTeam" >
                                <h:outputLabel value="#{acceptedTeam}" /><br/>
                            </ui:repeat>
                            <h5 class="fancy"> Unaccepted</h5>
                            <ui:repeat value="#{leagueBean.unacceptedTeams}" var="unacceptedTeam" >
                                <h:outputLabel value="#{unacceptedTeam}" /><br/>
                            </ui:repeat>
                        </h:panelGrid>
                </div>
                <h:outputLabel value="#{leagueButton.error}" id="leagueError" />
                <p:commandButton value="Accept" actionListener="#{leagueBean.accept}" update="leagueError" />
                <p:commandButton value="Decline" actionListener="#{leagueBean.decline}" update="leagueError" />
        </div>
    </ui:define>
    
</ui:composition>